home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / pipeline / abacus / p_line / DataBase2 / ReadMe < prev   
Encoding:
Text File  |  1993-02-26  |  10.4 KB  |  205 lines

  1. %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938 
  2. %OP%DP0
  3. %OP%IRY
  4. %OP%PL0
  5. %OP%HM0
  6. %OP%FM0
  7. %OP%BM0
  8. %OP%LM4
  9. %OP%PT1
  10. %OP%PDPipeLine
  11. %OP%WC1026,2258,184,1748,0,0,0,0
  12. %CO:A,72,72%
  13. %C%A Simple DataBase - Part 2
  14. %C%by Gerald L Fitton
  15. Keywords:
  16. Beginners database Fitton
  17.  
  18. Introduction
  19. In DataBase1 I described what is perhaps the simplest of databases.  
  20. Each record uses one row in a PipeDream document and has values for 
  21. every one of five 'Fields'.  In this directory I shall describe what I 
  22. think is an instructive (but not the best) way of adding a new record 
  23. and how to use the database to generate 'form letters'.  I shall also 
  24. show one way of producing labels using dependent documents leaving a 
  25. second method (using a parameter file) for another occasion.
  26.  
  27. Surprisingly I haven't received a file of "E-Y-B" ("Eligible Young 
  28. Bachelors") yet so the file is called [Girls02] and it is based on the 
  29. file, [Girls01] from directory DataBase1.  You can find a copy of 
  30. [Girls02] in this directory.  Just as you did with DataBase1, print out 
  31. [Girls02].
  32.  
  33. Start with [Girls01] from the DataBase1 directory and modify it by 
  34. inserting a few rows in the places shown in [Girls02].  All the 
  35. formulae will change appropriately.  The five fields are: 'Name', 'Hair 
  36. Colour', 'Eye Colour', 'Character' and 'Favourite Present' for each of 
  37. the eight (fictitious) young ladies.
  38.  
  39. Adding Rows
  40. Perhaps the simplest way of adding a row is to place the cursor 
  41. somewhere in the middle of the data and tap F7 to insert a row.  All 
  42. the formulae in row 7 will change to match the enlarged database.  Type 
  43. in the data and, if you want to, you can sort the database again on any 
  44. column or columns.  You can also delete a record using F8 to delete a 
  45. whole row.  What you must not do is delete either of the two blank rows 
  46. which bracket the data (ie the ones referenced in the formulae).  In 
  47. the file [Girls02] these are rows 8 and 17.
  48.  
  49. An alternative way of entering data is by copying a master row.  The 
  50. master row is row 4.  Type in data such as that shown.  Now, using the 
  51. mouse, place the cursor on the 4 of row 4 (ie in the margin or 
  52. 'border') and double click.  Row 4 will become highlighted ('marked' as 
  53. in 'marked block').  Now use the mouse to position the cursor anywhere 
  54. in column A within the data base (A9 to A16), click once and then copy 
  55. the marked block (Ctrl BC).  Finally, delete the word "Master:" (using 
  56. F11) and you can go back to the master row (row 4) and modify the data 
  57. for the next record.
  58.  
  59. Generally, this is a reasonably good method if you have a lot of 
  60. fields, many of which don't alter from record to record.  It is 
  61. possible to write a macro which will mark the master row, copy the 
  62. record to the database and bring the cursor back to the master row 
  63. ready for the next data entry - but that is a technique for experts.
  64.  
  65. A Form Letter
  66. Rows 19 to 21 contain a "Form Letter".  A form letter is usually a 
  67. letter sent to all (or many of) the people whose names are in the 
  68. database.  Often the fields are names and addresses, money owed, prizes 
  69. you might have won, etc, but we have other more attractive 
  70. characteristics of our eligible young ladies.  The letter is typed in 
  71. with lots of @@ characters bracketing cell references from row 7 as:
  72.  
  73. @@C7@@, I thought of you; I remembered your beautiful @@E7@@ eyes, your
  74. @@D7@@ hair and your @@F7@@ character. I decided I had to get you 
  75. @@G7@@.
  76.  
  77. Note that the cell references do not have to appear in the form letter 
  78. in column (or any other) order; any reference can appear anywhere in 
  79. the form letter.  If you want extra space for a long field then add 
  80. extra @@ signs behind the cell reference such as @@C7@@@@@@@@@@@@@.
  81.  
  82. If Sandy is typed into B7 then all values in row 7 will change to pick 
  83. up the values from the database (the block B9 to F16), this is followed 
  84. by the form letter picking up the cell references so that lines 19 to 
  85. 21 will read:
  86.  
  87. Sandy, I thought of you; I remembered your beautiful blue eyes, your
  88. auburn hair and your fiery character. I decided I had to get you 
  89. a sports car.
  90.  
  91. Mark rows 19 to 21 and (from the Print menu) Print marked block.  The 
  92. references will be evaluated before printing.  You have printed a "Form 
  93. Letter"!  By changing the value in cell B7 to say, Liz, you can send a 
  94. similar customised letter to Liz!  Try it now.
  95.  
  96. Labels
  97. The most usual use of linking a database to a label generating 
  98. application is to produce address labels.  My example isn't for address 
  99. labels.  It uses the database of E-Y-Ls; perhaps you want to label 
  100. boxes of mementoes of the times you have spent together - photos, cds, 
  101. restaurant bills, etc.  Although there are many ways of producing 
  102. labels from a database, essentially these fall into two classes; these 
  103. are: (a) using dependent documents or (b) using parameter files.  I 
  104. shall deal only with (a) on this disc.
  105.  
  106. Labels Using Dependent Documents
  107. Before you produce a set of labels you may want to sort the file so 
  108. that you can print a selection of the labels rather than all of them.  
  109. I prefer to have the labels I want to print at the bottom of the 
  110. database but you might prefer them at the top.  You can complicate the 
  111. formulae in the label generating document and not sort the database but 
  112. I don't want to explain how to do that at the moment.
  113.  
  114. From this directory, load the file [Label01].  For the purpose of this 
  115. tutorial I have assumed that you have a single column of labels with 
  116. each label having two columns.  I have also assumed that the vertical 
  117. distance from the top of one label to the next is 10 PipeDream lines.  
  118. If these values are unsuitable for your labels then you can modify the 
  119. file accordingly.
  120.  
  121. The advantage of using 10 rows per label for this tutorial is that each 
  122. label starts on a row such as 1, 11, 21, 31, etc and the printing 
  123. occupies lines 4 to 8, 14 to 18, etc. This makes it a little easier for 
  124. us 'denary' thinkers to see what is going on (eg the first 10 labels 
  125. use lines 1 to 99 inclusive).  By the way, I reckon that for most data 
  126. transfer problems it's better to consider that computers 'think' in a 
  127. scale of 256 (expressed as a two digit hex number - a byte) rather than 
  128. in the binary code taught so extensively in most elementary text books 
  129. on computing - sixteen ounces one pound, sixteen pounds one byte?
  130.  
  131. The cell [Label01]B4 contains the value of the key field for the first 
  132. label.  You can type in 'Jane' (the value) or the cell reference 
  133. [Girls02]B9.  The [Girls02] part of this cell reference indicates that 
  134. the value you want is in the dependent document called [Girls02].  Make 
  135. sure that [Girls02] is loaded or PipeDream might not find the file.
  136.  
  137. If you are repeating the creation of [Label01] then tap <F2> (the 
  138. function key which gives Edit Function) and type the formula in 
  139. carefully remembering to enter the $ signs where they are shown.  When 
  140. you press <Return> the word 'blond' will appear in cell B5.
  141.  
  142. Mark cells B5 to B8 and replicate with <Ctrl BRD> (Block Replicate 
  143. Down).  The result will be 'blond' in all four cells.  There are many 
  144. good ways of modifying the 'faulty' formulae but here's an instructive 
  145. one.  Place the cursor in cell [Label01]B6 and call up the sub menu 
  146. <Ctrl BSE> (Block SEarch).  In the dialogue box 'String to search for' 
  147. enter C and in the 'Replace with' with D.  PipeDream will not change 
  148. the C to a D in the formula unless you turn ON 'Search expression 
  149. slots' by clicking the mouse in that dialogue box.  Repeat this for 
  150. cells B7 and B8 changing the Cs to Es and Fs respectively.
  151.  
  152. Note that B14 appears in the formulae for the second label where B4 
  153. appears in the first - otherwise the formulae are identical.
  154.  
  155. Move the cursor to cell [Label01]B14 and type in the formula.  If you 
  156. have not done so already tap F2 to convert the text to a formula.  This 
  157. lookup formula finds Jane in the range B8B17 and then returns the value 
  158. found in the corresponding place in the range B9B18 (ie one record down 
  159. the database); the value returned is Janet.  Try it first and then 
  160. think about it!
  161.  
  162. If it is not still marked then mark the block [Label01]B5B8.  Place the 
  163. cursor in [Label01]B15 and then <Ctrl BRE> to replicate the block B5B8 
  164. to B15B18.  During this replication the B4s will change to B14s but 
  165. (because of the $s) all the rest of the lookup formulae will be fixed.  
  166. If you have done all this correctly then you will get, not the correct 
  167. formulae but the second label.
  168.  
  169. You can replicate the block A11B20 down the column of labels as far as 
  170. you wish.  Generally the quickest way of doing this is by doubling the 
  171. block size at every replication - this way it takes 10 replications to 
  172. produce 1024 labels.  Generally it doesn't matter if the label 
  173. generator is too long - you can always delete some of it.  Save this 
  174. master label generator.
  175.  
  176. Before printing your labels you can mark the whole [Label01] document 
  177. and use <Ctrl BSS> (Block SnapShot) to convert all the formulae to 
  178. values (but don't Save this over the top of the [Label01] file that 
  179. contains the formulae or you will lose these formulae and have to start 
  180. again).  This snapshotted file is editable as a plain text file so you 
  181. can delete individual labels, add columns, move blocks around, etc, and 
  182. see exactly what you have got before finally printing.  Particularly 
  183. with RISC OS drivers you can do useful things such as change the font, 
  184. change the line spacing or change the print scale factor.
  185.  
  186. If all your lookup formulae give values which are aligned right and you 
  187. want them aligned to the left margin then you can change this.  Double 
  188. click on the B at the top of the B column to mark the whole B column, 
  189. then give the command <Ctrl LAL> (Layout Align Left).
  190.  
  191. Once you have the [Label01] file you can use it with databases other 
  192. than [Girls02].  For example, suppose you want to use it with [Girls03] 
  193. (your own - not on this disc) then you could rename [Girls02] to 
  194. something else and then rename [Girls03] as [Girls02].  I use a variant 
  195. of this method.  My label file is used with files called [Addresses1], 
  196. [Addresses2], [Addresses3], etc; I make a copy (using Copy) of the 
  197. wanted file calling the copy [Addresses].  [Addresses] is the name of 
  198. my dependent document in my [Label] generator.  That way I can use the 
  199. same label generator document with many different address files.
  200.  
  201. A way of changing all the Girls02 to Girls is to mark the whole of your 
  202. label file and follow this with <Ctrl BSE> (Block SEarch) to replace 
  203. [Girls02] with, say, [Girls] (remember to turn 'Search expression 
  204. slots' ON).  Save the new label generator as [Label].
  205.